package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HmzReturnMasterMapper;
import com.ruoyi.system.domain.HmzReturnMaster;
import com.ruoyi.system.service.IHmzReturnMasterService;

/**
 * 归还单主Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-31
 */
@Service
public class HmzReturnMasterServiceImpl implements IHmzReturnMasterService 
{
    @Autowired
    private HmzReturnMasterMapper hmzReturnMasterMapper;

    /**
     * 查询归还单主
     * 
     * @param id 归还单主主键
     * @return 归还单主
     */
    @Override
    public HmzReturnMaster selectHmzReturnMasterById(Long id)
    {
        return hmzReturnMasterMapper.selectHmzReturnMasterById(id);
    }

    /**
     * 查询归还单主列表
     * 
     * @param hmzReturnMaster 归还单主
     * @return 归还单主
     */
    @Override
    public List<HmzReturnMaster> selectHmzReturnMasterList(HmzReturnMaster hmzReturnMaster)
    {
        return hmzReturnMasterMapper.selectHmzReturnMasterList(hmzReturnMaster);
    }

    /**
     * 新增归还单主
     * 
     * @param hmzReturnMaster 归还单主
     * @return 结果
     */
    @Override
    public int insertHmzReturnMaster(HmzReturnMaster hmzReturnMaster)
    {
        hmzReturnMaster.setCreateTime(DateUtils.getNowDate());
        return hmzReturnMasterMapper.insertHmzReturnMaster(hmzReturnMaster);
    }

    /**
     * 修改归还单主
     * 
     * @param hmzReturnMaster 归还单主
     * @return 结果
     */
    @Override
    public int updateHmzReturnMaster(HmzReturnMaster hmzReturnMaster)
    {
        hmzReturnMaster.setUpdateTime(DateUtils.getNowDate());
        return hmzReturnMasterMapper.updateHmzReturnMaster(hmzReturnMaster);
    }

    /**
     * 批量删除归还单主
     * 
     * @param ids 需要删除的归还单主主键
     * @return 结果
     */
    @Override
    public int deleteHmzReturnMasterByIds(Long[] ids)
    {
        return hmzReturnMasterMapper.deleteHmzReturnMasterByIds(ids);
    }

    /**
     * 删除归还单主信息
     * 
     * @param id 归还单主主键
     * @return 结果
     */
    @Override
    public int deleteHmzReturnMasterById(Long id)
    {
        return hmzReturnMasterMapper.deleteHmzReturnMasterById(id);
    }
}
